﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HRMS_Model;
using DataManager;

namespace HRMS.Controllers
{
    public class Departments
    {
        
        public static void AddDepartment(Department department)
        {
            using (var deptEntity = new HRMSEntities())
            {
                deptEntity.Departments.AddObject(department);
                deptEntity.SaveChanges();
            }
        }

        public static List<Department> GetDepartments()
        {
            using (var depEmtity = new HRMSEntities())
            {
                return depEmtity.Departments.ToList();
            }
        }
    }
}